import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:gourmet/color/hex.dart';
import 'package:gourmet/route/index.dart';
import 'package:gourmet/utils/colors.dart';
import 'package:gourmet/utils/radian.dart';
import 'package:gourmet/utils/styles.dart';
import 'package:gourmet/utils/svg.dart';

class MineWalletController extends GetxController {}

class MineWalletPage extends GetView<MineWalletController> {
  const MineWalletPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: HexColor(ColorsUtils.colorF7f7),
      appBar: AppBar(
        leading: IconButton(
          onPressed: Get.back,
          icon: Icon(
            CupertinoIcons.chevron_back,
            size: 18,
            color: HexColor(ColorsUtils.color0000),
          ),
        ),
        backgroundColor: Colors.white,
        systemOverlayStyle: SystemUiOverlayStyle.dark,
        centerTitle: true,
        title: Text(
          '我的钱包',
          style: StylesUtils.customTextStyle(
              fontSize: StylesUtils.fontSize18,
              fontWeight: FontWeight.w700,
              color: ColorsUtils.color0000),
        ),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              alignment: Alignment.center,
              margin: const EdgeInsets.only(top: 10),
              child: Container(
                constraints:
                    const BoxConstraints.expand(width: 345, height: 180),
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(10),
                  //linear-gradient(90deg, rgba(255, 153, 0, 1) 0%, rgba(255, 153, 0, 1) 0%, rgba(254, 70, 1, 1) 100%, rgba(254, 70, 1, 1) 100%)
                  gradient: LinearGradient(
                    colors: [
                      ColorsUtils.rgba(255, 153, 0, 1),
                      ColorsUtils.rgba(255, 153, 0, 1),
                      ColorsUtils.rgba(254, 70, 1, 1),
                      ColorsUtils.rgba(254, 70, 1, 1)
                    ],
                    stops: const [0, 0, 1.0, 1.0],
                    begin: const Alignment(0, 1),
                    end: const Alignment(1, 0),
                    transform: GradientRotation(
                      RadianUtils.angleToRadian(90),
                    ),
                  ),
                ),
                child: Column(
                  children: [
                    Container(
                      alignment: Alignment.centerLeft,
                      padding: const EdgeInsets.only(
                          top: 15, right: 2, bottom: 2, left: 15),
                      child: Text(
                        '总资产（元）',
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize13,
                        ),
                      ),
                    ),
                    Container(
                      margin: const EdgeInsets.only(top: 30, bottom: 20),
                      alignment: Alignment.center,
                      child: Text(
                        '35.00',
                        style: StylesUtils.customTextStyle(
                            fontSize: StylesUtils.fontSize28,
                            fontWeight: FontWeight.w700),
                      ),
                    ),
                    Row(
                      children: [
                        Expanded(
                          child: GestureDetector(
                            onTap: () {
                              Get.toNamed(Routes.mineRedEnvelope);
                            },
                            child: Column(
                              children: [
                                Container(
                                  height: 25,
                                  alignment: Alignment.center,
                                  child: Text(
                                    '25.00',
                                    style: StylesUtils.customTextStyle(
                                        fontSize: StylesUtils.fontSize18,
                                        fontWeight: FontWeight.w700),
                                  ),
                                ),
                                Container(
                                  height: 25,
                                  alignment: Alignment.center,
                                  child: Text(
                                    '红包（元）',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize13,
                                    ),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                        Center(
                          child: Container(
                            width: 1,
                            height: 41,
                            color: HexColor(ColorsUtils.colorFca19),
                          ),
                        ),
                        Expanded(
                          child: GestureDetector(
                            onTap: () {
                              Get.toNamed(Routes.mineMerchantVoucher);
                            },
                            child: Column(
                              children: [
                                Container(
                                  height: 25,
                                  alignment: Alignment.center,
                                  child: Text(
                                    '10.00',
                                    style: StylesUtils.customTextStyle(
                                        fontSize: StylesUtils.fontSize18,
                                        fontWeight: FontWeight.w700),
                                  ),
                                ),
                                Container(
                                  height: 25,
                                  alignment: Alignment.center,
                                  child: Text(
                                    '代金券（元）',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize13,
                                    ),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            ),
            Container(
              alignment: Alignment.center,
              margin: const EdgeInsets.only(top: 10),
              child: Container(
                constraints:
                    const BoxConstraints.expand(width: 345, height: 135),
                decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(10),
                ),
                child: Column(
                  children: [
                    Container(
                      padding: const EdgeInsets.only(
                          top: 15, right: 2, bottom: 2, left: 15),
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '钱包助手',
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize15,
                          fontWeight: FontWeight.w700,
                          color: ColorsUtils.color0000,
                        ),
                      ),
                    ),
                    Padding(
                      padding: const EdgeInsets.only(top: 20),
                      child: Row(
                        children: [
                          GestureDetector(
                            child: Column(
                              children: [
                                Center(
                                  child: SvgUtils.assetName('u8147',
                                      width: 25, height: 26),
                                ),
                                Container(
                                  margin: const EdgeInsets.only(top: 15),
                                  width: 86,
                                  alignment: Alignment.center,
                                  child: Text(
                                    '支付账单',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize13,
                                      color: ColorsUtils.color0000,
                                    ),
                                  ),
                                ),
                              ],
                            ),
                            onTap: () {
                              Get.toNamed(Routes.minePaymentBill);
                            },
                          ),
                          Column(
                            children: [
                              Center(
                                child: SvgUtils.assetName('u467',
                                    width: 28, height: 28),
                              ),
                              Container(
                                margin: const EdgeInsets.only(top: 15),
                                width: 86,
                                alignment: Alignment.center,
                                child: Text(
                                  '发票助手',
                                  style: StylesUtils.customTextStyle(
                                    fontSize: StylesUtils.fontSize13,
                                    color: ColorsUtils.color0000,
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
